<template>
  <button @click="start()">开始倒计时</button>
  <button @click="pause()">停止定时器</button>
  <h1>{{ countTime }}</h1>
</template>

<script>
import { useCountDown } from '@/compostitons'

export default {
  setup () {
    // 调用封装的函数
    // const { countTime, start, pause } = useCountDown(5)
    // return { countTime, start, pause }
    // 化简后写法
    return { ...useCountDown(10) }
  }
}
</script>
